/***************************************************************************
 *   SDL_rwz.c -- SDL_RWops zlib compression/decompression stream          *
 *     implimentation                                                      *
 *                                                                         *
 *   Copyright (C) 2004 by Tyler Montbriand                                *
 *   tsm@accesscomm.ca                                                     *
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 *   This program is distributed in the hope that it will be useful,       *
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 *   GNU General Public License for more details.                          *
 *                                                                         *
 *   You should have received a copy of the GNU General Public License     *
 *   along with this program; if not, write to the                         *
 *   Free Software Foundation, Inc.,                                       *
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
 ***************************************************************************/


#include "SDL_rwnull.h"
#include "SDL_rwlib_internal.h"

#define PKGNAME DONOTHING

//RWFUNC_SEEK_STUB(PKGNAME); /* A do-nothing seek stub */

RWFUNC_SEEK(PKGNAME)
 /*(SDL_RWops *ctx, int offset, int whence)*/
{
  const char *seek;
  switch(whence)
  {
  case SEEK_SET: seek="SEEK_SET";
    break;
  case SEEK_END: seek="SEEK_END";
    break;
  case SEEK_CUR: seek="SEEK_CUR";
    break;
  default:
    seek="(INVALID)";
    break;
  }

  fprintf(stderr,"%s(ctx=%p, offset=%d, whence=%s);\n",
    __FUNCTION__,ctx,offset,seek);
  return(-1);
}

RWFUNC_READ(PKGNAME)
  /*(SDL_RWops *ctx, void *ptr, int size, int maxnum)*/
{
  fprintf(stderr,"%s(ctx=%p, ptr=%p, size=%d, maxnum=%d);\n",
    __FUNCTION__,ctx,ptr,size,maxnum);

  return(-1);
}

RWFUNC_WRITE(PKGNAME)
  /*(SDL_RWops *ctx, const void *ptr, int size, int maxnum)*/
{
  fprintf(stderr,"%s(ctx=%p, ptr=%p, size=%d, maxnum=%d);\n",
    __FUNCTION__,ctx,ptr,size,maxnum);

  return(-1);
}

RWFUNC_CLOSE(PKGNAME)
  /*(SDL_RWops *ctx)*/
{
  fprintf(stderr,"%s(ctx=%p);\n",__FUNCTION__,ctx);

  if(ctx->type!=RW_TYPENUM(PKGNAME))
  {
    SDL_SetError("%s:  SDL_RWops is the wrong type!",__FUNCTION__);
    return(-1);
  }

  SDL_FreeRW(ctx);
  return(0);
}

SDL_RWops *SDL_RWFromNULL()
{
  SDL_RWops *rw=SDL_AllocRW();

  fprintf(stderr,"%s:()\n",__FUNCTION__);

  if(rw==NULL) return(NULL);

  RW_INITFUNC(rw,PKGNAME);
  return(rw);
}
